;; Copyright © 2017 Kei Kebreau <kkebreau@posteo.net>

;; This program is free software: you can redistribute it and/or modify
;; it under the terms of the GNU General Public License as published by
;; the Free Software Foundation, either version 3 of the License, or
;; (at your option) any later version.

;; This program is distributed in the hope that it will be useful,
;; but WITHOUT ANY WARRANTY; without even the implied warranty of
;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
;; GNU General Public License for more details.

;; You should have received a copy of the GNU General Public License
;; along with this program.  If not, see <http://www.gnu.org/licenses/>.

(define-module (scheme)
  #:use-module (guix packages)
  #:use-module (gnu packages)
  #:use-module ((guix licenses) #:prefix license:)
  #:use-module (guix download)
  #:use-module (guix utils)
  #:use-module (guix build-system gnu)
  #:use-module (gnu packages java)
  #:use-module (gnu packages readline)
  #:use-module (gnu packages texinfo))

(define-public kawa
  (package
    (name "kawa")
    (version "3.0")
    (source (origin
              (method url-fetch)
              (uri (string-append
                    "mirror://gnu/kawa/kawa-" version ".tar.gz"))
              (sha256
               (base32
                "1k9qpydc64ar4aqyg3q7jmmxy503ayj85227qfhc5n6ngchqavhy"))))
    (build-system gnu-build-system)
    (arguments
     '(#:parallel-build? #f
       #:configure-flags '("--enable-kawa-frontend")
       #:phases
       (modify-phases %standard-phases
         (add-after 'build 'build-doc
           (lambda _
             (with-directory-excursion "doc"
               (invoke "make" "kawa-html/index.html")))))))
    (native-inputs
     `(("jdk" ,icedtea-8 "jdk")
       ("texinfo" ,texinfo)))
    (inputs
     `(("readline" ,readline)))
    (synopsis "A Scheme implementation on the Java platform")
    (description
     "Kawa is a general-purpose programming language that runs on the Java
platform.  It aims to combine the benefits of dynamic scripting languages with
the benefits of traditional compiled languages.")
    (home-page "https://www.gnu.org/software/kawa/")
    (license license:expat)))
